﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace DigitalImage.softLib.stages {
    class CCTcolorInverse: IColorTransformation {

        public Bitmap transform(Bitmap inputImage) {
            byte[,,]image=CImageUtil.bitmapToColorMatrix(inputImage);
            for(int i=0;i<image.GetLength(0);i++) {
                for(int j=0;j<image.GetLength(1);j++) {
                    image[i, j, 0]=(byte)(255-image[i, j, 0]);
                    image[i, j, 1]=(byte)(255-image[i, j, 1]);
                    image[i, j, 2]=(byte)(255-image[i, j, 2]);
                }
            }
            return CImageUtil.colorMatrixToBitmap(image);
        }
    }
}
